package stream.Demo06;

import java.io.Serializable;

/**
 * @Author Miku
 * @Create 2021/4/30 9:08
 */
public class Student implements Serializable {

    /**
     * 序列化版本ID，保证序列化的类和反序列化的类是同一个类
     */
    private static final long serialVersionUID = 1L;

    /**
     * 使用transient(瞬间的)修饰属性，这个属性不能被序列化
     * 静态属性不能序列化
     */
    private String name;
    private int age;

    public Student(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }
}
